package com.clei.Y2023.M10.D13.com;

import com.clei.Y2023.M10.D13.mqtt.MqttPublisher;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttMessage;

/**
 * 消息回调处理
 *
 * @author Y
 * @date 2023-10-23
 */
public class MqttMessageCallback implements MqttCallback {
    public void connectionLost(Throwable cause) {
        // 连接丢失后，一般在这里面进行重连
        MqttPublisher.connect();
    }

    public void messageArrived(String topic, MqttMessage message) throws Exception {
    }

    public void deliveryComplete(IMqttDeliveryToken token) {
    }
}